<?php
	$data=$this->getRows("select * from {$this->prename}odds");
	// print_r($data);exit;
?>
<article class="module width_full">
<input type="hidden" value="<?=$this->user['username']?>" />
	<header><h3 class="tabs_involved">赔率设置</h3></header>
	<table class="tablesorter" cellspacing="0" width="100%">
		<thead>
			<tr>
				<td>赔率名称</td>
				<td>赔率</td>
				<td>操作</td>
			</tr>
		</thead>
		<tbody id="nav01">
		<?php if($data) foreach($data as $var){ ?>
			<tr>
				<td><?=$var['odd_name']?></td>
				<td><input type="number" min="1" max="3.00" step="0.01" name="odds" id="odds_<?=$var['odd_id']?>" class="textWid1" value="<?=$var['odds']?>"/></td>
               
				<!-- <td><a href="/admin778899.php/system/updateOdds/<?=$var['odd_id']?>" target="ajax" method="POST" onajax="sysBeforeUpdateType" call="odds">保存修改</a></td> -->
				<td><a style="cursor: pointer;" onclick="xiugai(<?=$var['odd_id']?>)">保存修改</a></td>
			</tr>
		<?php  } ?>
		</tbody>
	</table>
</article>
<script type="text/javascript">
	function xiugai(odd_id){
		var odds = $('#odds_'+odd_id).val();
		$.ajax({
                url:"/admin778899.php/system/updateOddsss",
                type:'post',
                cache:false,
                dataType:'JSON',
                timeout: 10000,
                data:{"odds":odds,"odd_id":odd_id},
                success:function(dete){
                    // alert('修改成功');
                    // console.log(dete);
                    if (dete == 1) {
                    	alert('修改成功');
                    }else{
                    	alert('修改失败');
                    }
                    // window.location.reload();
                }
            })
	}
	
</script>
